package com.sqx.modules.bl.commission.jjr.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.bl.commission.jjr.entity.JjrApply;
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
import com.sqx.modules.bl.commission.jjr.service.JjrApplyService;
import com.sqx.modules.bl.commission.jjr.service.JjrDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@RequestMapping("/app/commission/jjr")
@Api(value = "分佣管理", tags = {"经纪人管理app"})
public class AppJjrController {

    @Autowired
    private JjrApplyService applyService;

    @GetMapping("/apply")
    @ApiOperation("申请经纪人")
    public Result apply(JjrApply jjrApply){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        jjrApply.setCreateTime(sdf.format(new Date()));
        applyService.add(jjrApply);
        return Result.success();
    }

}
