|
@@ -0,0 +1,103 @@
|
|
|
+package com.miaxis.app.controller.birthday;
|
|
|
+
|
|
|
+import com.miaxis.birthday.domain.BirthdayLog;
|
|
|
+import com.miaxis.birthday.service.IBirthdayLogService;
|
|
|
+import com.miaxis.common.constant.Constants;
|
|
|
+import com.miaxis.common.core.controller.BaseController;
|
|
|
+import com.miaxis.common.core.domain.Response;
|
|
|
+import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.utils.SecurityUtils;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【查询记录】Controller
|
|
|
+ *
|
|
|
+ * @author miaxis
|
|
|
+ * @date 2023-12-11
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping(Constants.STUDENT_PREFIX + "/birthday/log")
|
|
|
+@Api(tags = {"【app-查询记录】"})
|
|
|
+public class BirthdayLogController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private IBirthdayLogService birthdayLogService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询查询记录列表
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("查询查询记录列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<BirthdayLog> list(@ModelAttribute BirthdayLog birthdayLog) {
|
|
|
+ startPage();
|
|
|
+ Long bbq = SecurityUtils.getLoginUser().getStudent().getId();
|
|
|
+ Long bbq2 = SecurityUtils.getLoginUser().getUser().getUserId();
|
|
|
+ System.out.println(bbq);
|
|
|
+ System.out.println(bbq2);
|
|
|
+ birthdayLog.setUserId(SecurityUtils.getLoginUser().getStudent().getId());
|
|
|
+ List<BirthdayLog> list = birthdayLogService.selectBirthdayLogList(birthdayLog);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取查询记录详细信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取查询记录详细信息")
|
|
|
+ public Response<BirthdayLog> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "查询记录参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ) {
|
|
|
+ return Response.success(birthdayLogService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增查询记录
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增查询记录") public Response<Integer> add(@RequestBody BirthdayLog birthdayLog){
|
|
|
+ return toResponse(birthdayLogService.save(birthdayLog) ? 1 : 0);
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增查询记录
|
|
|
+ */
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增查询记录")
|
|
|
+ public Response<Integer> add(@RequestBody BirthdayLog birthdayLog) {
|
|
|
+ Long userId = SecurityUtils.getLoginUser().getStudent().getId();
|
|
|
+ birthdayLog.setUserId(userId);
|
|
|
+ return toResponse(birthdayLogService.saveBirthdayLog(birthdayLog) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改查询记录
|
|
|
+ */
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改查询记录")
|
|
|
+ public Response<Integer> edit(@RequestBody BirthdayLog birthdayLog) {
|
|
|
+ return toResponse(birthdayLogService.updateById(birthdayLog) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除查询记录
|
|
|
+ */
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ @ApiOperation("删除查询记录")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "ids", value = "查询记录ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ) {
|
|
|
+ return toResponse(birthdayLogService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|