parent
5bac710287
commit
a695b39cdd
@ -0,0 +1,8 @@ |
||||
# 数据库的类型,目前仅支持mysql和mariadb两种sql服务器 |
||||
database.dbType = "mariadb" |
||||
database.url = "jdbc:mariadb://example:3386/Trailblazer?characterEncoding=utf-8" |
||||
database.userName = "tuser" |
||||
database.password = "abcd" |
||||
|
||||
JWT.signAlgo = "HS256" |
||||
JWT.secretKey = "asdifusaydiuasdczxcvmnbvamhdfgasjdhfuweygfiwqueygf" |
@ -0,0 +1,5 @@ |
||||
package me.lensfrex.trailblazer.api.v1.dao.sql; |
||||
|
||||
public interface ProfileDaoInterface { |
||||
|
||||
} |
@ -0,0 +1,79 @@ |
||||
package me.lensfrex.trailblazer.api.v1.pojos; |
||||
|
||||
import java.util.Date; |
||||
|
||||
public class ProfileItems { |
||||
public int uid; |
||||
public String nick_name; |
||||
public String desc; |
||||
public String sign; |
||||
public Date birthday; |
||||
public int sex; |
||||
public String email; |
||||
|
||||
public ProfileItems(int uid, String nick_name, String desc, String sign, Date birthday, int sex, String email) { |
||||
this.uid = uid; |
||||
this.nick_name = nick_name; |
||||
this.desc = desc; |
||||
this.sign = sign; |
||||
this.birthday = birthday; |
||||
this.sex = sex; |
||||
this.email = email; |
||||
} |
||||
|
||||
public int getUid() { |
||||
return uid; |
||||
} |
||||
|
||||
public void setUid(int uid) { |
||||
this.uid = uid; |
||||
} |
||||
|
||||
public String getNick_name() { |
||||
return nick_name; |
||||
} |
||||
|
||||
public void setNick_name(String nick_name) { |
||||
this.nick_name = nick_name; |
||||
} |
||||
|
||||
public String getDesc() { |
||||
return desc; |
||||
} |
||||
|
||||
public void setDesc(String desc) { |
||||
this.desc = desc; |
||||
} |
||||
|
||||
public String getSign() { |
||||
return sign; |
||||
} |
||||
|
||||
public void setSign(String sign) { |
||||
this.sign = sign; |
||||
} |
||||
|
||||
public Date getBirthday() { |
||||
return birthday; |
||||
} |
||||
|
||||
public void setBirthday(Date birthday) { |
||||
this.birthday = birthday; |
||||
} |
||||
|
||||
public int getSex() { |
||||
return sex; |
||||
} |
||||
|
||||
public void setSex(int sex) { |
||||
this.sex = sex; |
||||
} |
||||
|
||||
public String getEmail() { |
||||
return email; |
||||
} |
||||
|
||||
public void setEmail(String email) { |
||||
this.email = email; |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
package me.lensfrex.trailblazer.api.v1.service.profile; |
||||
|
||||
import jakarta.ws.rs.GET; |
||||
import jakarta.ws.rs.Path; |
||||
import jakarta.ws.rs.PathParam; |
||||
import jakarta.ws.rs.Produces; |
||||
import jakarta.ws.rs.core.MediaType; |
||||
|
||||
@Path("/profile") |
||||
public class Profile { |
||||
|
||||
@GET |
||||
@Path("/getItems/{uid}") |
||||
@Produces(MediaType.APPLICATION_JSON) |
||||
public String getProfiles(@PathParam("uid") String uid) { |
||||
return "unfinished feature..."; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
||||
<mapper namespace="me.lensfrex.trailblazer.api.v1.dao.sql.UserDaoInterface"> |
||||
<select id="getAllProfileItems" resultType="me.lensfrex.trailblazer.api.v1.pojos.ProfileItems" |
||||
parameterType="java.lang.Integer"> |
||||
select * |
||||
from `Trailblazer`.`account_info` |
||||
where uid = #{uid}; |
||||
</select> |
||||
|
||||
<insert id="addItems" parameterType="me.lensfrex.trailblazer.api.v1.pojos.ProfileItems"> |
||||
insert into `Trailblazer`.`account_info` (`uid`, `nick_name`, `desc`, `sign`, `birthday`, `sex`, `email`) |
||||
values (#{uid}, #{nickName}, #{desc}, #{sign}, #{birthday}, #{sex}, #{email}); |
||||
</insert> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue