Skip to content

Commit

Permalink
Merge pull request #10 from opensourceways/release/openeuler/sql
Browse files Browse the repository at this point in the history
Release/openeuler/sql
  • Loading branch information
shishupei authored Jan 7, 2025
2 parents 475a075 + 75e7e89 commit 4ac12bd
Show file tree
Hide file tree
Showing 17 changed files with 990 additions and 441 deletions.
10 changes: 5 additions & 5 deletions common/cassandra/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved
package cassandra

type Config struct {
Host string `json:"host" required:"true"`
User string `json:"user" required:"true"`
Pwd string `json:"pwd" required:"true"`
Name string `json:"name" required:"true"`
Port int `json:"port" required:"true"`
Host string `json:"host" required:"true"`
User string `json:"user" required:"true"`
Password string `json:"pwd" required:"true"`
Name string `json:"name" required:"true"`
Port int `json:"port" required:"true"`
}
2 changes: 1 addition & 1 deletion common/cassandra/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Init(cfg *Config) error {
cluster.Port = cfg.Port
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: cfg.User,
Password: cfg.Pwd,
Password: cfg.Password,
}
sessionInstance, err := cluster.CreateSession()
if err != nil {
Expand Down
12 changes: 11 additions & 1 deletion common/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"regexp"

"github.com/gin-gonic/gin"
"github.com/opensourceways/message-manager/common/postgresql"
"github.com/sirupsen/logrus"
"golang.org/x/xerrors"
)
Expand Down Expand Up @@ -92,7 +93,7 @@ func getManagerToken(appId string, appSecret string) (string, error) {
return data.ManagerToken, nil
}

func GetEulerUserName(ctx *gin.Context) (string, error) {
func GetSystemUserName(ctx *gin.Context) (string, error) {
token := ctx.Request.Header.Get("token")
YGCookie, err := extractYGCookie(ctx.Request.Header.Get("Cookie"))
if err != nil {
Expand Down Expand Up @@ -151,3 +152,12 @@ func fetchUserName(managerToken, userToken, YGCookie string) (string, error) {
}
return data.UserName, nil
}

func GetThirdUserName(userName string) (string, error) {
var thirdUsername string
query := `select gitee_user_name from recipient_config where user_id = ?`
if result := postgresql.DB().Raw(query, userName).Scan(&thirdUsername); result.Error != nil {
return "", result.Error
}
return thirdUsername, nil
}
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
gorm.io/datatypes v1.2.0
gorm.io/driver/postgres v1.5.7
gorm.io/gorm v1.25.10
gorm.io/gorm v1.25.12
k8s.io/apimachinery v0.29.3
sigs.k8s.io/yaml v1.4.0
)
Expand All @@ -28,6 +28,7 @@ require (
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dmitryburov/gorm-paginator v0.9.6 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
Expand Down Expand Up @@ -67,9 +68,9 @@ require (
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQ
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dmitryburov/gorm-paginator v0.9.6 h1:ymzpXzsFH1I6CzwzKhSW/E3TJToOWIuBOU0GU5JxIgE=
github.com/dmitryburov/gorm-paginator v0.9.6/go.mod h1:6FEjK8jxnb8OLBjDZSfsAr6RhlKKyaIarsvHponvwAM=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4=
Expand All @@ -41,6 +43,7 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
Expand Down Expand Up @@ -72,6 +75,7 @@ github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
Expand Down Expand Up @@ -168,6 +172,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -187,6 +193,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
Expand All @@ -208,6 +216,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/datatypes v1.2.0 h1:5YT+eokWdIxhJgWHdrb2zYUimyk0+TaFth+7a0ybzco=
gorm.io/datatypes v1.2.0/go.mod h1:o1dh0ZvjIjhH/bngTpypG6lVRJ5chTBxE09FH/71k04=
gorm.io/driver/mysql v1.0.3/go.mod h1:twGxftLBlFgNVNakL7F+P/x9oYqoymG3YYT8cAfI9oI=
gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y=
gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM=
Expand All @@ -216,9 +225,13 @@ gorm.io/driver/sqlite v1.4.3 h1:HBBcZSDnWi5BW3B3rwvVTc510KGkBkexlOg0QrmLUuU=
gorm.io/driver/sqlite v1.4.3/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI=
gorm.io/driver/sqlserver v1.4.1 h1:t4r4r6Jam5E6ejqP7N82qAJIJAht27EGT41HyPfXRw0=
gorm.io/driver/sqlserver v1.4.1/go.mod h1:DJ4P+MeZbc5rvY58PnmN1Lnyvb5gw5NPzGshHDnJLig=
gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.20.7/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s=
gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU=
k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU=
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
Expand Down
83 changes: 57 additions & 26 deletions message/app/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,41 @@ import (

type MessageListAppService interface {
CountAllUnReadMessage(userName string) ([]CountDTO, error)
SetMessageIsRead(cmd *CmdToSetIsRead) error
RemoveMessage(cmd *CmdToSetIsRead) error
SetMessageIsRead(userName string, eventId string) error
RemoveMessage(userName string, eventId string) error

GetAllToDoMessage(userName string, giteeUsername string, isDone bool,
pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error)
GetAllToDoMessage(userName string, giteeUsername string, isDone *bool,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetAllAboutMessage(userName string, giteeUsername string, isBot *bool,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetAllWatchMessage(userName string, giteeUsername string,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)

CountAllMessage(userName string, giteeUsername string) (CountDataDTO, error)

GetForumSystemMessage(userName string, pageNum, countPerPage int,
startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetForumAboutMessage(userName string, isBot *bool, pageNum,
countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetMeetingToDoMessage(userName string, filter int, pageNum, countPerPage int) (
[]MessageListDTO, int64, error)
GetCVEToDoMessage(userName string, giteeUsername string, isDone bool,
pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error)
GetMeetingToDoMessage(userName string, filter int, pageNum, countPerPage int,
startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetCVEToDoMessage(userName string, giteeUsername string, isDone *bool,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetCVEMessage(userName string, giteeUsername string,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetIssueToDoMessage(userName string, giteeUsername string, isDone bool,
pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error)
GetPullRequestToDoMessage(userName string, giteeUsername string, isDone bool,
pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error)
GetIssueToDoMessage(userName string, giteeUsername string, isDone *bool,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetPullRequestToDoMessage(userName string, giteeUsername string, isDone *bool,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetGiteeAboutMessage(userName string, giteeUsername string, isBot *bool,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetGiteeMessage(userName string, giteeUsername string, pageNum,
countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error)
GetEurMessage(userName string, pageNum, countPerPage int,
startTime string, isRead *bool) ([]MessageListDTO, int64, error)

GetAllMessage(userName string, pageNum, countPerPage int, isRead *bool) ([]MessageListDTO,
int64, error)
}

func NewMessageListAppService(
Expand All @@ -63,28 +68,32 @@ func (s *messageListAppService) CountAllUnReadMessage(userName string) ([]CountD
}
return count, nil
}
func (s *messageListAppService) SetMessageIsRead(cmd *CmdToSetIsRead) error {
if err := s.messageListAdapter.SetMessageIsRead(cmd.Source, cmd.EventId); err != nil {

func (s *messageListAppService) SetMessageIsRead(userName string, eventId string) error {
if err := s.messageListAdapter.SetMessageIsRead(userName, eventId); err != nil {
return xerrors.Errorf("set message is_read failed, err:%v", err.Error())
}
return nil
}
func (s *messageListAppService) RemoveMessage(cmd *CmdToSetIsRead) error {
if err := s.messageListAdapter.RemoveMessage(cmd.Source, cmd.EventId); err != nil {

func (s *messageListAppService) RemoveMessage(userName string, eventId string) error {
if err := s.messageListAdapter.RemoveMessage(userName, eventId); err != nil {
return xerrors.Errorf("set message is_read failed, err:%v", err.Error())
}
return nil
}

func (s *messageListAppService) GetAllToDoMessage(userName string, giteeUsername string,
isDone bool, pageNum, countPerPage int, startTime string) (
isDone *bool, pageNum, countPerPage int, startTime string, isRead *bool) (
[]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetAllToDoMessage(userName, giteeUsername,
isDone, pageNum, countPerPage, startTime)
isDone, pageNum, countPerPage, startTime, isRead)
if err != nil {
return []MessageListDTO{}, 0, err
}
return response, count, nil
}

func (s *messageListAppService) GetAllAboutMessage(userName string, giteeUsername string,
isBot *bool, pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetAllAboutMessage(userName, giteeUsername,
Expand All @@ -94,6 +103,7 @@ func (s *messageListAppService) GetAllAboutMessage(userName string, giteeUsernam
}
return response, count, nil
}

func (s *messageListAppService) GetAllWatchMessage(userName string, giteeUsername string,
pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetAllWatchMessage(userName, giteeUsername,
Expand All @@ -103,6 +113,7 @@ func (s *messageListAppService) GetAllWatchMessage(userName string, giteeUsernam
}
return response, count, nil
}

func (s *messageListAppService) GetForumSystemMessage(userName string, pageNum, countPerPage int,
startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetForumSystemMessage(userName, pageNum,
Expand All @@ -112,6 +123,7 @@ func (s *messageListAppService) GetForumSystemMessage(userName string, pageNum,
}
return response, count, nil
}

func (s *messageListAppService) GetForumAboutMessage(userName string, isBot *bool, pageNum,
countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetForumAboutMessage(userName, isBot, pageNum,
Expand All @@ -121,24 +133,27 @@ func (s *messageListAppService) GetForumAboutMessage(userName string, isBot *boo
}
return response, count, nil
}

func (s *messageListAppService) GetMeetingToDoMessage(userName string, filter int, pageNum,
countPerPage int) ([]MessageListDTO, int64, error) {
countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetMeetingToDoMessage(userName, filter,
pageNum, countPerPage)
pageNum, countPerPage, startTime, isRead)
if err != nil {
return []MessageListDTO{}, 0, err
}
return response, count, nil
}

func (s *messageListAppService) GetCVEToDoMessage(userName string, giteeUsername string,
isDone bool, pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error) {
isDone *bool, pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetCVEToDoMessage(userName, giteeUsername,
isDone, pageNum, countPerPage, startTime)
isDone, pageNum, countPerPage, startTime, isRead)
if err != nil {
return []MessageListDTO{}, 0, err
}
return response, count, nil
}

func (s *messageListAppService) GetCVEMessage(userName string, giteeUsername string, pageNum,
countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetCVEMessage(userName, giteeUsername, pageNum,
Expand All @@ -148,24 +163,28 @@ func (s *messageListAppService) GetCVEMessage(userName string, giteeUsername str
}
return response, count, nil
}

func (s *messageListAppService) GetIssueToDoMessage(userName string, giteeUsername string,
isDone bool, pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error) {
isDone *bool, pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetIssueToDoMessage(userName, giteeUsername,
isDone, pageNum, countPerPage, startTime)
isDone, pageNum, countPerPage, startTime, isRead)
if err != nil {
return []MessageListDTO{}, 0, err
}
return response, count, nil
}

func (s *messageListAppService) GetPullRequestToDoMessage(userName string, giteeUsername string,
isDone bool, pageNum, countPerPage int, startTime string) ([]MessageListDTO, int64, error) {
isDone *bool, pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO,
int64, error) {
response, count, err := s.messageListAdapter.GetPullRequestToDoMessage(userName,
giteeUsername, isDone, pageNum, countPerPage, startTime)
giteeUsername, isDone, pageNum, countPerPage, startTime, isRead)
if err != nil {
return []MessageListDTO{}, 0, err
}
return response, count, nil
}

func (s *messageListAppService) GetGiteeAboutMessage(userName string, giteeUsername string,
isBot *bool, pageNum, countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetGiteeAboutMessage(userName, giteeUsername,
Expand All @@ -175,6 +194,7 @@ func (s *messageListAppService) GetGiteeAboutMessage(userName string, giteeUsern
}
return response, count, nil
}

func (s *messageListAppService) GetGiteeMessage(userName string, giteeUsername string, pageNum,
countPerPage int, startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetGiteeMessage(userName, giteeUsername,
Expand All @@ -184,6 +204,7 @@ func (s *messageListAppService) GetGiteeMessage(userName string, giteeUsername s
}
return response, count, nil
}

func (s *messageListAppService) GetEurMessage(userName string, pageNum, countPerPage int,
startTime string, isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetEurMessage(userName, pageNum, countPerPage,
Expand All @@ -193,10 +214,20 @@ func (s *messageListAppService) GetEurMessage(userName string, pageNum, countPer
}
return response, count, nil
}

func (s *messageListAppService) CountAllMessage(userName string, giteeUsername string) (CountDataDTO, error) {
data, err := s.messageListAdapter.CountAllMessage(userName, giteeUsername)
if err != nil {
return CountDataDTO{}, err
}
return data, nil
}

func (s *messageListAppService) GetAllMessage(userName string, pageNum, countPerPage int,
isRead *bool) ([]MessageListDTO, int64, error) {
response, count, err := s.messageListAdapter.GetAllMessage(userName, pageNum, countPerPage, isRead)
if err != nil {
return []MessageListDTO{}, 0, err
}
return response, count, nil
}
Loading

0 comments on commit 4ac12bd

Please sign in to comment.