40 lines
1.9 KiB
Go
40 lines
1.9 KiB
Go
|
package mongo
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"finclip-app-manager/domain/repository"
|
||
|
mgo "gitlab.finogeeks.club/finclip-backend-v2/finclip-mgo"
|
||
|
"gitlab.finogeeks.club/finclip-backend-v2/finclip-mgo/bson"
|
||
|
)
|
||
|
|
||
|
var _ repository.ILinkAuditRepo = new(LinkAuditByMongoRepo)
|
||
|
|
||
|
type LinkAuditByMongoRepo struct {
|
||
|
}
|
||
|
|
||
|
type LinkAuditMongo struct {
|
||
|
AuditId string `json:"auditId" bson:"audit_id"` //id
|
||
|
Version int `json:"version" bson:"version"` //审核序号
|
||
|
AppId string `json:"appId" bson:"app_id"` //应用名称
|
||
|
AppName string `json:"appName" bson:"app_name"` //应用名称
|
||
|
BindingId string `json:"bindingId" bson:"binding_id"` //应用名称
|
||
|
BindingName string `json:"bindingName" bson:"binding_name"` //应用名称
|
||
|
GroupID string `json:"groupId" bson:"group_id"` //企业ID
|
||
|
Owner string `json:"owner" bson:"owner"` //所属企业
|
||
|
ApplyBy string `json:"applyBy" bson:"apply_by"` // 申请人
|
||
|
ApplyStatus string `json:"applyStatus" bson:"apply_status"` // 审核状态
|
||
|
ApplyAt int64 `json:"applyAt" bson:"apply_at"` // timestamp
|
||
|
AuditBy string `json:"auditBy" bson:"audit_by"` // 审核人
|
||
|
AuditAt int64 `json:"auditAt" bson:"audit_at"` // 审核人
|
||
|
AssociateStatus string `json:"associateStatus" bson:"associate_status"` //绑定状态
|
||
|
Reason string `json:"reason" bson:"reason"` //原因
|
||
|
}
|
||
|
|
||
|
func (l LinkAuditByMongoRepo) Count(ctx context.Context, appID string, groupId string, bindingID string, stLinkAudit string) (int, error) {
|
||
|
return linkAuditTable.Count(ctx, bson.M{"app_id": appID, "group_id": groupId, "binding_id": bindingID, "apply_status": stLinkAudit})
|
||
|
}
|
||
|
|
||
|
func (l LinkAuditByMongoRepo) NotFound(err error) bool {
|
||
|
return err == mgo.ErrNotFound
|
||
|
}
|