package com.dxhy.core.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dxhy.common.aspect.SysLog;
import com.dxhy.common.controller.AbstractController;
import com.dxhy.common.utils.R;
import com.dxhy.core.job.service.ApplyService;

import lombok.extern.slf4j.Slf4j;

/**
 * @author user
 */
@RestController
@Slf4j

public class SetPwdController extends AbstractController {

    @Resource
    private ApplyService applyservice;

    /**
     * 设置密码
     *
     * @param params
     *            查询条件
     * @return 返回
     */
    @SysLog("设置业务密码")
    @RequestMapping("/setPwd")
    public R setPwd(@RequestBody Map<String, String> params) {
        String msg = "";
        try {
            msg = applyservice.setPwd(params);
        } catch (Exception e) {
           log.info("业务处理异常：{}", e);
        }

        return R.ok(msg);
    }

    /**
     * 设置密码
     *
     * @param params
     *            查询条件
     * @return 返回
     */
    @SysLog("重置业务密码")
    @RequestMapping("/resetPwd")
    public R resetPwd(@RequestBody Map<String, String> params) {
        String msg = "";
        try {
            msg = applyservice.resetPwd(params);
        } catch (Exception e) {
           log.info("业务处理异常：{}", e);
        }

        return R.ok(msg);
    }
}
