IfaFundController.java 1.8 KB
Newer Older
张亚辉's avatar
张亚辉 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
package com.tanpu.fund.controller;

import com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth;
import com.tanpu.common.model.fund.req.FundNoNavReq;
import com.tanpu.common.model.fund.resq.FundNoNavResp;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.fund.api.IfaFundApi;
import com.tanpu.fund.service.IfaFundService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: zyh
 * @date: 2021-03-13 2:44 下午
 * @description:
 */
@RestController
public class IfaFundController implements IfaFundApi {

    @Resource
    private IfaFundService ifaFundService;

    @TanpuInterfaceLoginAuth
    @Override
    public CommonResp fundnonavAdd(FundNoNavReq req) {
        if (StringUtils.isEmpty(req.getFundName())) {
            return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
        }

        this.ifaFundService.fundnonavAdd(req);
        return CommonResp.success();
    }

    @TanpuInterfaceLoginAuth
    @Override
    public CommonResp fundnonavEdit(FundNoNavReq req) {
        if (StringUtils.isEmpty(req.getId()) || StringUtils.isEmpty(req.getFundName())) {
            return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
        }

        this.ifaFundService.fundnonavEdit(req);
        return CommonResp.success();
    }

    @Override
    public CommonResp<FundNoNavResp> fundnonavDetail(String id) {
        if (StringUtils.isEmpty(id)) {
            return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
        }
        return CommonResp.success(this.ifaFundService.fundnonavDetail(id));
    }

}