feat: playroom related logic refactor
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package xin.merlin.myplayerbackend.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -7,7 +8,7 @@ import lombok.Data;
|
||||
@Data
|
||||
@TableName("playroominfo")
|
||||
public class PlayroomInfo {
|
||||
@TableId("r_id")
|
||||
@TableId(value = "r_id",type = IdType.AUTO)
|
||||
private Integer r_id;
|
||||
|
||||
private String r_name;
|
||||
|
||||
@@ -2,12 +2,15 @@ package xin.merlin.myplayerbackend.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("playrooms")
|
||||
@AllArgsConstructor
|
||||
public class Playrooms {
|
||||
private Integer r_id;
|
||||
private Integer id;
|
||||
private Integer role;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@ import lombok.Data;
|
||||
@Data
|
||||
@TableName("userinfo")
|
||||
public class UserInfo {
|
||||
@TableId("u_id")
|
||||
private String u_id;
|
||||
|
||||
@TableId("id")
|
||||
private Integer id;
|
||||
private String u_name;
|
||||
private String u_introduction;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package xin.merlin.myplayerbackend.entity.http;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import xin.merlin.myplayerbackend.entity.PlayroomInfo;
|
||||
import xin.merlin.myplayerbackend.entity.Playrooms;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PlayroomDetails {
|
||||
private Integer id;
|
||||
private Integer r_id;
|
||||
private String r_name;
|
||||
private String r_introduction;
|
||||
private String r_avatar;
|
||||
private Integer role;
|
||||
|
||||
public PlayroomDetails(PlayroomInfo playroomInfo, Playrooms playrooms) {
|
||||
this.id = playrooms.getId();
|
||||
this.r_id = playrooms.getR_id();
|
||||
this.role = playrooms.getRole();
|
||||
this.r_name = playroomInfo.getR_name();
|
||||
this.r_introduction = playroomInfo.getR_introduction();
|
||||
this.r_avatar = playroomInfo.getR_avatar();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user