Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoyanbin
nbya
Commits
48f8f0fd
Commit
48f8f0fd
authored
Jan 22, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Msg
parent
0697acd4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
14 deletions
+21
-14
org_player_user.go
app/mobile/apis/org_player_user.go
+2
-0
org_msg.go
app/mobile/service/dto/org_msg.go
+3
-0
org_msg.go
app/mobile/service/org_msg.go
+1
-0
org_user.go
app/operate/apis/org_user.go
+3
-3
org_msg.go
app/operate/models/org_msg.go
+10
-9
org_user.go
app/operate/service/org_user.go
+2
-2
No files found.
app/mobile/apis/org_player_user.go
View file @
48f8f0fd
...
@@ -65,6 +65,7 @@ func (e OrgPlayerUser) GetMsg(c *gin.Context) {
...
@@ -65,6 +65,7 @@ func (e OrgPlayerUser) GetMsg(c *gin.Context) {
}
}
reqMsg
.
Username
=
req
.
Username
reqMsg
.
Username
=
req
.
Username
reqMsg
.
Code
=
code
reqMsg
.
Code
=
code
reqMsg
.
MsgType
=
"1"
err
=
sMsg
.
Insert
(
&
reqMsg
)
err
=
sMsg
.
Insert
(
&
reqMsg
)
smsText
:=
"您的验证码为:"
+
code
smsText
:=
"您的验证码为:"
+
code
...
@@ -126,6 +127,7 @@ func (e OrgPlayerUser) Login(c *gin.Context) {
...
@@ -126,6 +127,7 @@ func (e OrgPlayerUser) Login(c *gin.Context) {
}
}
reqMsg
.
Username
=
req
.
Username
reqMsg
.
Username
=
req
.
Username
reqMsg
.
Code
=
req
.
Code
reqMsg
.
Code
=
req
.
Code
reqMsg
.
MsgType
=
"1"
err
=
sMsg
.
Get
(
&
reqMsg
)
err
=
sMsg
.
Get
(
&
reqMsg
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Logger
.
Error
(
err
)
...
...
app/mobile/service/dto/org_msg.go
View file @
48f8f0fd
...
@@ -18,6 +18,7 @@ type OrgMsgInsertReq struct {
...
@@ -18,6 +18,7 @@ type OrgMsgInsertReq struct {
Id
int
`json:"-" comment:""`
//
Id
int
`json:"-" comment:""`
//
Code
string
`json:"code" comment:""`
Code
string
`json:"code" comment:""`
Username
string
`json:"username" comment:""`
Username
string
`json:"username" comment:""`
MsgType
string
`json:"msgType" comment:""`
common
.
ControlBy
common
.
ControlBy
}
}
...
@@ -27,6 +28,7 @@ func (s *OrgMsgInsertReq) Generate(model *models.OrgMsg) {
...
@@ -27,6 +28,7 @@ func (s *OrgMsgInsertReq) Generate(model *models.OrgMsg) {
}
}
model
.
Code
=
s
.
Code
model
.
Code
=
s
.
Code
model
.
Username
=
s
.
Username
model
.
Username
=
s
.
Username
model
.
MsgType
=
s
.
MsgType
}
}
func
(
s
*
OrgMsgInsertReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgMsgInsertReq
)
GetId
()
interface
{}
{
...
@@ -56,6 +58,7 @@ func (s *OrgMsgUpdateReq) GetId() interface{} {
...
@@ -56,6 +58,7 @@ func (s *OrgMsgUpdateReq) GetId() interface{} {
type
OrgMsgGetReq
struct
{
type
OrgMsgGetReq
struct
{
Username
string
`json:"username"`
Username
string
`json:"username"`
Code
string
`json:"code"`
Code
string
`json:"code"`
MsgType
string
`json:"msgType"`
}
}
// OrgMsgDeleteReq 功能删除请求参数
// OrgMsgDeleteReq 功能删除请求参数
...
...
app/mobile/service/org_msg.go
View file @
48f8f0fd
...
@@ -51,6 +51,7 @@ func (e *OrgMsg) Get(d *dto.OrgMsgGetReq) error {
...
@@ -51,6 +51,7 @@ func (e *OrgMsg) Get(d *dto.OrgMsgGetReq) error {
Where
(
"code=?"
,
d
.
Code
)
.
Where
(
"code=?"
,
d
.
Code
)
.
Where
(
"username=?"
,
d
.
Username
)
.
Where
(
"username=?"
,
d
.
Username
)
.
Where
(
"created_at>?"
,
nowBefore5Minute
)
.
Where
(
"created_at>?"
,
nowBefore5Minute
)
.
Where
(
"msg_type=?"
,
d
.
MsgType
)
.
Order
(
"id desc"
)
.
Order
(
"id desc"
)
.
First
(
&
reply
)
.
Error
First
(
&
reply
)
.
Error
if
err
!=
nil
&&
errors
.
Is
(
err
,
gorm
.
ErrRecordNotFound
)
{
if
err
!=
nil
&&
errors
.
Is
(
err
,
gorm
.
ErrRecordNotFound
)
{
...
...
app/operate/apis/org_user.go
View file @
48f8f0fd
...
@@ -25,7 +25,7 @@ type OrgUser struct {
...
@@ -25,7 +25,7 @@ type OrgUser struct {
// @Summary <赛事>列表用户信息数据
// @Summary <赛事>列表用户信息数据
// @Description 获取JSON
// @Description 获取JSON
// @Tags 用户
// @Tags 用户
// @Param
username query string false "username
"
// @Param
data body dto.OrgUserGetPageReq true "data
"
// @Success 200 {string} {object} response.Response "{"code": 200, "data": [...]}"
// @Success 200 {string} {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/org-user [get]
// @Router /api/v1/org-user [get]
// @Security Bearer
// @Security Bearer
...
@@ -150,7 +150,7 @@ func (e OrgUser) Insert(c *gin.Context) {
...
@@ -150,7 +150,7 @@ func (e OrgUser) Insert(c *gin.Context) {
// @Tags 用户
// @Tags 用户
// @Accept application/json
// @Accept application/json
// @Product application/json
// @Product application/json
// @Param data body dto.
Sys
UserUpdateReq true "body"
// @Param data body dto.
Org
UserUpdateReq true "body"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-user/{userId} [put]
// @Router /api/v1/org-user/{userId} [put]
// @Security Bearer
// @Security Bearer
...
@@ -223,7 +223,7 @@ func (e OrgUser) Delete(c *gin.Context) {
...
@@ -223,7 +223,7 @@ func (e OrgUser) Delete(c *gin.Context) {
// @Tags 用户
// @Tags 用户
// @Accept application/json
// @Accept application/json
// @Product application/json
// @Product application/json
// @Param data body dto.
UpdateSysUser
StatusReq true "body"
// @Param data body dto.
OrgUserUpdate
StatusReq true "body"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-user/status [put]
// @Router /api/v1/org-user/status [put]
// @Security Bearer
// @Security Bearer
...
...
app/operate/models/org_msg.go
View file @
48f8f0fd
package
models
package
models
import
(
import
(
// "gorm.io/gorm"
// "gorm.io/gorm"
"go-admin/common/models"
"go-admin/common/models"
)
)
type
OrgMsg
struct
{
type
OrgMsg
struct
{
models
.
Model
models
.
Model
Code
string
`json:"code" gorm:"type:varchar(20);comment:Code"`
Code
string
`json:"code" gorm:"type:varchar(20);comment:Code"`
Username
string
`json:"username" gorm:"type:varchar(20);comment:Username"`
Username
string
`json:"username" gorm:"type:varchar(20);comment:Username"`
models
.
ModelTime
MsgType
string
`json:"msgType" gorm:"type:varchar(20);comment:MsgType"`
models
.
ControlBy
models
.
ModelTime
models
.
ControlBy
}
}
func
(
OrgMsg
)
TableName
()
string
{
func
(
OrgMsg
)
TableName
()
string
{
return
"org_msg"
return
"org_msg"
}
}
func
(
e
*
OrgMsg
)
Generate
()
models
.
ActiveRecord
{
func
(
e
*
OrgMsg
)
Generate
()
models
.
ActiveRecord
{
...
@@ -26,4 +27,4 @@ func (e *OrgMsg) Generate() models.ActiveRecord {
...
@@ -26,4 +27,4 @@ func (e *OrgMsg) Generate() models.ActiveRecord {
func
(
e
*
OrgMsg
)
GetId
()
interface
{}
{
func
(
e
*
OrgMsg
)
GetId
()
interface
{}
{
return
e
.
Id
return
e
.
Id
}
}
\ No newline at end of file
app/operate/service/org_user.go
View file @
48f8f0fd
...
@@ -19,7 +19,7 @@ type OrgUser struct {
...
@@ -19,7 +19,7 @@ type OrgUser struct {
func
(
e
*
OrgUser
)
GetPage
(
c
*
dto
.
OrgUserGetPageReq
,
p
*
actions
.
DataPermission
,
list
*
[]
dto
.
OrgUserGetPageReply
,
count
*
int64
)
error
{
func
(
e
*
OrgUser
)
GetPage
(
c
*
dto
.
OrgUserGetPageReq
,
p
*
actions
.
DataPermission
,
list
*
[]
dto
.
OrgUserGetPageReply
,
count
*
int64
)
error
{
var
err
error
var
err
error
var
data
models
.
SysUser
var
data
models
.
SysUser
field
:=
"su.user_id, su.username, su.nick_name, su.nick_name_en, sr.role_name, su.status"
field
:=
"su.user_id, su.username, su.nick_name, su.nick_name_en, s
u.role_id, s
r.role_name, su.status"
err
=
e
.
Orm
.
Table
(
"sys_user as su"
)
.
err
=
e
.
Orm
.
Table
(
"sys_user as su"
)
.
Select
(
field
)
.
Select
(
field
)
.
...
@@ -42,7 +42,7 @@ func (e *OrgUser) GetPage(c *dto.OrgUserGetPageReq, p *actions.DataPermission, l
...
@@ -42,7 +42,7 @@ func (e *OrgUser) GetPage(c *dto.OrgUserGetPageReq, p *actions.DataPermission, l
// Get 获取OrgTeamUser对象
// Get 获取OrgTeamUser对象
func
(
e
*
OrgUser
)
Get
(
d
*
dto
.
OrgUserGetReq
,
p
*
actions
.
DataPermission
,
model
*
dto
.
OrgUserGetReply
)
error
{
func
(
e
*
OrgUser
)
Get
(
d
*
dto
.
OrgUserGetReq
,
p
*
actions
.
DataPermission
,
model
*
dto
.
OrgUserGetReply
)
error
{
field
:=
"su.user_id, su.username, su.nick_name, su.nick_name_en, su.status"
field
:=
"su.user_id, su.username, su.nick_name, su.nick_name_en, su.
role_id, su.
status"
err
:=
e
.
Orm
.
Table
(
"sys_user as su"
)
.
err
:=
e
.
Orm
.
Table
(
"sys_user as su"
)
.
Select
(
field
)
.
Select
(
field
)
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment