Blame view

FieldDictController.java 2.04 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 54 55 56 57 58 59 60 61 62
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.field.QueryFieldsDTO;
import com.subsidy.model.FieldDictDO;
import com.subsidy.service.FieldDictService;
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;
import io.swagger.annotations.Api;

/**
 * <p>
 * 行业字典表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2024-01-11
 */
@RestController
@Api(tags = "行业字典表")
@RequestMapping("/fieldDict")
public class FieldDictController {

    @Autowired
    private FieldDictService fieldDictService;

    @PostMapping("queryFields")
    @ApiOperation("查询行业 pageSize  pageNum  fieldName")
    @LoginRequired
    public ResponseVO queryFields(@RequestBody QueryFieldsDTO queryFieldsDTO){
        return ResponseData.generateCreatedResponse(0,fieldDictService.queryFields(queryFieldsDTO));
    }

    @PostMapping("addField")
    @ApiOperation("添加行业  fieldName 行业名称")
    @LoginRequired
    public ResponseVO addField(@RequestBody FieldDictDO fieldDictDO){
        return ResponseData.generateCreatedResponse(0,fieldDictService.addField(fieldDictDO));
    }

    @PostMapping("updateField")
    @ApiOperation("修改行业 id fieldName 行业名称")
    @LoginRequired
    public ResponseVO updateField(@RequestBody FieldDictDO fieldDictDO){
        return ResponseData.generateCreatedResponse(0,fieldDictService.updateField(fieldDictDO));
    }

    @PostMapping("deleteField")
    @ApiOperation("删除行业 id")
    @LoginRequired
    public ResponseVO deleteField(@RequestBody FieldDictDO fieldDictDO){
        return ResponseData.generateCreatedResponse(0,fieldDictService.deleteField(fieldDictDO));
    }
}