FormulaController.java 1.88 KB
Newer Older
eddie.woo's avatar
eddie.woo committed
1 2 3 4 5 6 7 8
package pwc.taxtech.atms.controller;

import org.springframework.beans.factory.annotation.Autowired;
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;
9
import pwc.taxtech.atms.service.impl.FormulaServiceImpl;
eddie.woo's avatar
eddie.woo committed
10 11 12 13 14 15

@RestController
@RequestMapping("/api/v1/formula")
public class FormulaController extends BaseController {

    @Autowired
16
    FormulaServiceImpl formulaService;
eddie.woo's avatar
eddie.woo committed
17 18

    @ResponseBody
gary's avatar
gary committed
19
//    @ApiOperation(value = "")
eddie.woo's avatar
eddie.woo committed
20 21 22 23 24 25 26 27 28 29 30
    @RequestMapping(value = "get", method = RequestMethod.GET)
    public OperationResultDto getAllFormulaList() {
        try {
            return OperationResultDto.success(formulaService.getAllFormulaList());
        } catch (Exception e) {
            logger.error("getAllFormulaList error.", e);
        }
        return OperationResultDto.error();
    }

    @ResponseBody
gary's avatar
gary committed
31
//    @ApiOperation(value = "")
eddie.woo's avatar
eddie.woo committed
32 33 34 35 36 37 38 39 40 41 42
    @RequestMapping(value = "param/get", method = RequestMethod.GET)
    public OperationResultDto getAllFormulaConfigList() {
        try {
            return OperationResultDto.success(formulaService.getAllFormulaParamList());
        } catch (Exception e) {
            logger.error("getAllFormulaConfigList error.", e);
        }
        return OperationResultDto.error();
    }

    @ResponseBody
gary's avatar
gary committed
43
//    @ApiOperation(value = "")
eddie.woo's avatar
eddie.woo committed
44 45 46 47 48 49 50 51 52 53 54
    @RequestMapping(value = "parammapping/get", method = RequestMethod.GET)
    public OperationResultDto getAllFormulaParamMappingList() {
        try {
            return OperationResultDto.success(formulaService.getAllFormulaParamMappingList());
        } catch (Exception e) {
            logger.error("getAllFormulaParamMappingList error.", e);
        }
        return OperationResultDto.error();
    }

}