Blame view

YearDictController.java 1.53 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
package com.zhongzhi.controller;


import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.model.YearDictDO;
import com.zhongzhi.service.YearDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 年份字典表 前端控制器
 * </p>
 *
 * @author DengMin
 * @since 2023-04-11
 */
@RestController
@RequestMapping("/yearDict")
@Api(tags = "年份管理")
public class YearDictController {

    @Autowired
    private YearDictService yearDictService;

    @PostMapping("queryYears")
    @ApiOperation("查询年份")
    public ResponseVO queryYears(){
        return ResponseData.generateCreatedResponse(0,yearDictService.queryYears());
    }

    @PostMapping("updateYear")
    @ApiOperation("编辑年份 id year status")
    public ResponseVO updateYear(@RequestBody YearDictDO yearDictDO){
        yearDictService.updateYear(yearDictDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("addYear")
    @ApiOperation("添加年份 year status ")
    public ResponseVO addYear(@RequestBody YearDictDO yearDictDO){
        yearDictService.addYear(yearDictDO);
        return ResponseData.generateCreatedResponse(0);
    }

}