Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
chenweijian
hilo-user
Commits
62781316
Commit
62781316
authored
Jun 07, 2023
by
hujiebin
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db加一个type
parent
5e720856
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
27 deletions
+3
-27
anniversary.go
domain/model/cp_m/anniversary.go
+2
-0
anniversary.go
route/cp_r/anniversary.go
+1
-27
No files found.
domain/model/cp_m/anniversary.go
View file @
62781316
...
@@ -3,6 +3,7 @@ package cp_m
...
@@ -3,6 +3,7 @@ package cp_m
import
(
import
(
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/mysql"
"hilo-user/_const/enum/cp_e"
"time"
"time"
)
)
...
@@ -10,6 +11,7 @@ import (
...
@@ -10,6 +11,7 @@ import (
type
CpAnniversary
struct
{
type
CpAnniversary
struct
{
mysql
.
Entity
mysql
.
Entity
CpId
mysql
.
ID
CpId
mysql
.
ID
Type
cp_e
.
AnniversaryItemType
UserId1
mysql
.
ID
UserId1
mysql
.
ID
UserId2
mysql
.
ID
UserId2
mysql
.
ID
Content
string
Content
string
...
...
route/cp_r/anniversary.go
View file @
62781316
...
@@ -4,11 +4,8 @@ import (
...
@@ -4,11 +4,8 @@ import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/mycontext"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"hilo-user/_const/enum/cp_e"
"hilo-user/cv/cp_cv"
"hilo-user/cv/cp_cv"
"hilo-user/cv/user_cv"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/user_m"
"hilo-user/myerr/bizerr"
"hilo-user/myerr/bizerr"
"hilo-user/req"
"hilo-user/req"
"hilo-user/resp"
"hilo-user/resp"
...
@@ -94,33 +91,10 @@ func PageAnniversary(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -94,33 +91,10 @@ func PageAnniversary(c *gin.Context) (*mycontext.MyContext, error) {
}
}
var
response
=
make
([]
cp_cv
.
CvCpAnniversary
,
0
)
var
response
=
make
([]
cp_cv
.
CvCpAnniversary
,
0
)
model
:=
domain
.
CreateModelContext
(
myCtx
)
model
:=
domain
.
CreateModelContext
(
myCtx
)
cpRelation
,
exits
:=
cp_m
.
GetCpRelation
(
model
,
userId
)
if
exits
{
userIds
:=
[]
uint64
{
cpRelation
.
UserId1
,
cpRelation
.
UserId2
}
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
if
err
!=
nil
{
return
myCtx
,
err
}
cpUserId
:=
cpRelation
.
UserId2
if
cpUserId
==
userId
{
cpUserId
=
cpRelation
.
UserId1
}
userInfo
:=
user_cv
.
UserToTiny
(
users
[
userId
])
cpUserInfo
:=
user_cv
.
UserToTiny
(
users
[
cpUserId
])
response
=
append
(
response
,
cp_cv
.
CvCpAnniversary
{
Type
:
cp_e
.
AnniversaryItemTypeAvatar
,
CpInfo
:
&
cp_cv
.
CvCpBase
{
UserInfo
:
*
userInfo
,
CpUserInfo
:
*
cpUserInfo
,
},
Timestamp
:
cpRelation
.
CreatedTime
.
Unix
(),
CanDel
:
false
,
})
}
anniversary
:=
cp_m
.
GetAllCpAnniversary
(
model
,
userId
)
anniversary
:=
cp_m
.
GetAllCpAnniversary
(
model
,
userId
)
for
_
,
v
:=
range
anniversary
{
for
_
,
v
:=
range
anniversary
{
response
=
append
(
response
,
cp_cv
.
CvCpAnniversary
{
response
=
append
(
response
,
cp_cv
.
CvCpAnniversary
{
Type
:
cp_e
.
AnniversaryItemTypeNormal
,
Type
:
v
.
Type
,
Id
:
v
.
ID
,
Id
:
v
.
ID
,
Content
:
v
.
Content
,
Content
:
v
.
Content
,
Timestamp
:
v
.
Timestamp
,
Timestamp
:
v
.
Timestamp
,
...
...
hujiebin
@hujiebin
mentioned in commit
831fb5a9
·
Jun 07, 2023
mentioned in commit
831fb5a9
mentioned in commit 831fb5a906410591e9cc6e9887e51142b189eabf
Toggle commit list
hujiebin
@hujiebin
mentioned in commit
3afb6972
·
Jun 16, 2023
mentioned in commit
3afb6972
mentioned in commit 3afb697266adef6a5b5931c603f53a53ed9b4e25
Toggle commit list
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