ProjectStatusManageController.java 2.22 KB
Newer Older
1 2 3 4 5
package pwc.taxtech.atms.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
6
import org.springframework.web.bind.annotation.PathVariable;
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto;
import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.service.ProjectStatusManageService;

@RestController
@RequestMapping("/api/v1/ProjectStatusManage")
public class ProjectStatusManageController {

    @Autowired
    private ProjectStatusManageService projectStatusManageService;

23
    @Autowired
24 25 26
    private IdentityService identityService;

    @ApiOperation(value = "setProjectStatus", notes = "")
27
    @RequestMapping(value = {"/setProjectStatus/{dbName}/{periodId}/{status}"}, method = RequestMethod.GET,
28 29
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
30 31 32 33
    public OperationResultDto<ProjectStatusManageDto> setProjectStatus(@PathVariable("dbName") String dbName,
                                                                       @PathVariable("periodId") Integer periodId,
                                                                       @PathVariable("status") Integer status) {
        return projectStatusManageService.setProjectStatus(dbName, periodId, status, identityService.getIdentityUser().getID());
34
    }
35 36 37 38 39 40 41 42 43 44


    @ApiOperation(value = "getProjectStatus", notes = "")
    @RequestMapping(value = {"getProjectStatus/{dbName}/{projectId}/{periodId}"}, method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    public OperationResultDto<ProjectStatusManageDto> getProjectStatus(@PathVariable String dbName, @PathVariable String projectId,
                                                                       @PathVariable Integer periodId) {
        return projectStatusManageService.getProjectStatus(dbName, projectId, periodId);
    }
45
}