1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package contract
- import (
- "context"
- "log"
- "personnelBehavior/internal/dao"
- "personnelBehavior/internal/model"
- "personnelBehavior/internal/service"
- )
- //业务接口的实现
- type (
- sContract struct{}
- )
- func init() {
- log.Println("--初始 接口 实现--")
- service.RegisterContract(New())
- }
- func New() *sContract {
- return &sContract{}
- }
- // InsertRecords 用户行为记录
- func (s *sContract) InsertRecords(ctx context.Context, in model.ContractInsertInput, chainName string) (err error) {
- return dao.Contract.ExecInsert(ctx, in, chainName)
- }
- // IsExists 表是否存在
- func (s *sContract) IsExists(ctx context.Context, chainName string) (err error) {
- return dao.Contract.IsExists(ctx, chainName)
- }
- // UpdateRedis 更新redis 表信息
- func (s *sContract) UpdateRedis(ctx context.Context, chainName string) (err error) {
- return dao.Contract.UpdateRedis(ctx, chainName)
- }
- // CreateTable 创建表
- func (s *sContract) CreateTable(ctx context.Context, chainName string) (err error) {
- return dao.Contract.CreateTable(ctx, chainName)
- }
|