package com.jxy.system.controller;

import com.jxy.common.core.web.Result.AjaxResult;
import com.jxy.common.core.web.controller.BaseController;
import com.jxy.system.entity.StrategyLoginBody;
import com.jxy.system.entity.StrategyResetPwdBody;
import com.jxy.system.service.StrategyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @Description TODO
 * @Date 2023/1/30 11:29
 * @Author 杜懿
 */
@RestController
@RequestMapping("/strategy")
public class StrategyController extends BaseController {

    @Autowired
    private StrategyService strategyService;

    @PostMapping("login")
    public AjaxResult login(@RequestBody StrategyLoginBody loginBody, @RequestHeader("User-Agent") String userAgent)
    {
        return strategyService.login(loginBody);
    }

    @PostMapping("resetPwd")
    public AjaxResult resetPwd(@RequestBody @Valid StrategyResetPwdBody resetPwdBody)
    {
        return strategyService.resetPwd(resetPwdBody);
    }
}
