february-merchant-settlement/february-merchant-mybatis-plus/src/main/java/com/february/mybatisplus/controller/AdminController.java

29 lines
987 B
Java

package com.february.mybatisplus.controller;
import com.february.mybatisplus.demo.Tadmin;
import com.february.mybatisplus.service.AdminService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/login")
@Log4j2
public class AdminController {
@Autowired
private AdminService adminService;
@PostMapping("/loginAdmin")
public String loginAdmin(@RequestParam("adminName")String adminName,@RequestParam("adminPassword")String adminPassword){
Tadmin tadmin=adminService.loginAdmin(adminName,adminPassword);
if (tadmin!=null){
return "登陆成功";
}else {
return "登录失败";
}
}
}