This commit is contained in:
qiurunze 2019-01-24 10:09:27 +08:00
commit 772ee183ef
7 changed files with 145 additions and 63 deletions

View File

@ -7,4 +7,21 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>miaosha-admin-api</artifactId>
<dependencies>
<!--lombook引用-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.geekq</groupId>
<artifactId>miaosha-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,48 @@
package com.geekq.order.service;
import com.geekq.common.entity.MiaoshaUser;
import java.util.List;
import java.util.Map;
public interface MiaoShaUserService {
/**
* 注册
* @param username
* @param password
*/
void register(String username, String password);
/**
* 检查是否有重复的用户名
*/
boolean checkUsername(String name, int userType);
/**
* 用户登陆
* @param name
* @param password
* @return
*/
MiaoshaUser login(String name, String password, int userType, String ip);
/**
* 是否有管理员
* @return
*/
boolean hasAdmin();
/**
* 创建默认的管理员
*/
void createDefaultAdmin();
/**
* 查询用户的id和name
* @param word
* @param userType
* @return
*/
List<Map<String, Object>> autoComplate(String word, int userType);
}

View File

@ -0,0 +1,31 @@
package com.geekq.web.controller;
import com.geekq.common.utils.resultbean.ResultGeekQ;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class RegisterController extends BaseController{
@RequestMapping("/register")
@ResponseBody
public ResultGeekQ<Boolean> register(String username, String password) {
ResultGeekQ<Boolean> result = ResultGeekQ.build();
try {
} catch (RuntimeException e) {
}
return result;
}
@RequestMapping("/checkUsername")
@ResponseBody
public ResultGeekQ<Boolean> checkUsername(String username) {
ResultGeekQ<Boolean> result = ResultGeekQ.build();
try {
} catch (RuntimeException e) {
}
return result;
}
}

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>蓝源Eloan-P2P平台->用户注册</title>
<title>秒杀平台->用户注册</title>
<link rel="stylesheet" href="/js/bootstrap-3.3.2-dist/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="/css/core.css" type="text/css" />
<script type="text/javascript" src="/js/jquery/jquery-2.1.3.js"></script>
@ -171,22 +171,15 @@
<div class="container-foot-2">
<div class="context">
<div class="left">
<p>专注于高级Java开发工程师的培养</p>
<p>版权所有:&emsp;2015广州小码哥教育科技有限公司</p>
<p>&emsp;&emsp;址:&emsp;广州市天河区棠下荷光三横路盛达商务园D座5楼</p>
<p>&emsp;&emsp;话: 020-29007520&emsp;&emsp;
邮箱:&emsp;service@520it.com</p>
<p>
<a href="http://www.miitbeian.gov.cn" style="color: #ffffff">ICP备案
粤ICP备字1504547</a>
</p>
<p>
<a href="http://www.gzjd.gov.cn/wlaqjc/open/validateSite.do" style="color: #ffffff">穗公网安备44010650010086</a>
</p>
<p>we -- hello -- world </p>
<p>版权所有:&emsp;GeekQ</p>
<p>&emsp;&emsp;址:&emsp;北京市</p>
<p>Q&emsp;&emsp;Q 3341386488&emsp;&emsp;</p>
<p>邮 箱:&emsp;QiuRunZe_key@163.com</p>
</div>
<div class="right">
<a target="_blank" href="http://weibo.com/ITxiaomage"><img
src="/images/sina.png"></a>
<a target="_blank" href="https://github.com/qiurunze123/miaosha"><img
src="/images/geekq.png"></a>
</div>
<div class="clearfix"></div>
</div>

View File

@ -0,0 +1,26 @@
package com.geekq.common.entity;
import com.geekq.common.enums.Constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.Date;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class MiaoshaUser {
private Long id;
private String nickname;
private String password;
private String salt;
private Date registerDate;
private Date lastLoginDate;
private int state = Constants.STATE_NORMAL;
private int userType;//用户类型
private boolean admin = false;
}

View File

@ -0,0 +1,15 @@
package com.geekq.common.enums;
/**
* @author 邱润泽
* 常用数据静态变量类型集合
*/
public class Constants {
public static final int STATE_NORMAL = 0;
public static final int STATE_LOCK = 1;
public static final int STATE_DELETE = -1;
public static final int USERTYPE_NORMAL = 0;//前段用户
public static final int USERTYPE_SYSTEM = 1;//后台用户
}

View File

@ -1,48 +0,0 @@
package com.geekq.common.pojo;
import java.util.List;
/**
*
* @Description: 用来返回jqGrid的数据格式
*/
public class JqGridResult {
private int page; // 当前页数
private int total; // 总页数
private long records; // 总记录数
private List<?> rows; // 每行显示的内容
private Object userdata; // 用户自定义数据
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public long getRecords() {
return records;
}
public void setRecords(long records) {
this.records = records;
}
public List<?> getRows() {
return rows;
}
public void setRows(List<?> rows) {
this.rows = rows;
}
public Object getUserdata() {
return userdata;
}
public void setUserdata(Object userdata) {
this.userdata = userdata;
}
}