forked from qiurunze123/miaosha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
qiurunze
committed
Dec 11, 2018
1 parent
959a7ea
commit 70293b0
Showing
21 changed files
with
3,225 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/com/geekq/miaosha/controller/RegisterController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.geekq.miaosha.controller; | ||
|
||
import com.geekq.miaosha.common.resultbean.ResultGeekQ; | ||
import com.geekq.miaosha.domain.MiaoshaUser; | ||
import com.geekq.miaosha.service.MiaoShaUserService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
import javax.servlet.http.HttpServletResponse; | ||
|
||
import static com.geekq.miaosha.common.enums.ResultStatus.RESIGETER_FAIL; | ||
|
||
@Controller | ||
@RequestMapping("/user") | ||
public class RegisterController { | ||
|
||
private static Logger logger = LoggerFactory.getLogger(RegisterController.class); | ||
|
||
@Autowired | ||
private MiaoShaUserService miaoShaUserService; | ||
@RequestMapping("/do_register") | ||
public String registerIndex(){ | ||
return "register"; | ||
} | ||
|
||
/** | ||
* 注册网站 | ||
* @param userName | ||
* @param passWord | ||
* @param salt | ||
* @return | ||
*/ | ||
@RequestMapping("/register") | ||
@ResponseBody | ||
public ResultGeekQ<String> register(@RequestParam("username") String userName , | ||
@RequestParam("password") String passWord, | ||
@RequestParam("salt") String salt,HttpServletResponse response ){ | ||
|
||
ResultGeekQ<String> result = ResultGeekQ.build(); | ||
boolean registerInfo = miaoShaUserService.register(response , userName,passWord,salt); | ||
if(!registerInfo){ | ||
result.withError(RESIGETER_FAIL.getCode(),RESIGETER_FAIL.getMessage()); | ||
return result; | ||
} | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.