AcademyDictController.java 3.56 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.academy.AcademiesDTO;
import com.subsidy.dto.academy.AcademyAccountDTO;
import com.subsidy.dto.academy.AddAcademyAccountDTO;
import com.subsidy.dto.academy.AddAcademyDTO;
import com.subsidy.model.AcademyDictDO;
import com.subsidy.model.AdministerDO;
import com.subsidy.service.AcademyDictService;
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-02-23
 */
@RestController
@Api(tags = "院校字典表")
@RequestMapping("/academyDict")
public class AcademyDictController {

    @Autowired
    private AcademyDictService academyDictService;

    @PostMapping("/academies")
    @ApiOperation("院校管理  academyName  pageNum  pageSize")
    public ResponseVO academies(@RequestBody AcademiesDTO academiesDTO){
        return ResponseData.generateCreatedResponse(0,academyDictService.academies(academiesDTO));
    }

    @PostMapping("addAcademy")
    @ApiOperation("添加院校 accountName  academyName  shortName  location  academyType telephone userName")
    public ResponseVO addAcademy(@RequestBody AddAcademyDTO addAcademyDTO){
        return ResponseData.generateCreatedResponse(0,academyDictService.addAcademy(addAcademyDTO));
    }

    @PostMapping("deleteAcademy")
    @ApiOperation("删除院校 id ")
    public ResponseVO deleteAcademy(@RequestBody AcademyDictDO academyDictDO){
        return ResponseData.generateCreatedResponse(0,academyDictService.deleteAcademy(academyDictDO));
    }

    @PostMapping("updateAcademy")
    @ApiOperation("修改院校 id  academyName  shortName  location  academyType  accountName telephone userName password")
    public ResponseVO updateAcademy(@RequestBody AddAcademyDTO addAcademyDTO){
        return ResponseData.generateCreatedResponse(0,academyDictService.updateAcademy(addAcademyDTO));
    }

    @PostMapping("academyAccount")
    @ApiOperation("院校账户管理 pageSize pageNum academyName")
    public ResponseVO academyAccount(@RequestBody AcademyAccountDTO academyAccountDTO){
        return ResponseData.generateCreatedResponse(0,academyDictService.academyAccount(academyAccountDTO));
    }

    @PostMapping("addAcademyAccount")
    @ApiOperation("添加院校账户  academyIds[]  telephone  accountName  userName password  remark ")
    public ResponseVO addAcademyAccount(@RequestBody AddAcademyAccountDTO addAcademyAccountDTO){
        return ResponseData.generateCreatedResponse(0,academyDictService.addAcademyAccount(addAcademyAccountDTO));
    }

    @PostMapping("deleteAcademyAccount")
    @ApiOperation("删除院校账户  id ")
    public ResponseVO deleteAcademyAccount(@RequestBody AdministerDO administerDO){
        return ResponseData.generateCreatedResponse(0,academyDictService.deleteAcademyAccount(administerDO));
    }

    @PostMapping("updateAcademyAccount")
    @ApiOperation("编辑院校账户  id academyIds[]  telephone  accountName  userName password ")
    public ResponseVO updateAcademyAccount(@RequestBody AddAcademyAccountDTO addAcademyAccountDTO){
        return ResponseData.generateCreatedResponse(0,academyDictService.updateAcademyAccount(addAcademyAccountDTO));
    }


}