package base import ( "github.com/suyuan32/simple-admin-common/utils/pointy" "github.com/suyuan32/simple-admin-core/rpc/types/core" ) func (l *InitDatabaseLogic) insertApiData() (err error) { // LabelRelationship _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label_relationship/create"), Description: pointy.GetPointer("apiDesc.createLabelRelationship"), ApiGroup: pointy.GetPointer("label_relationship"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label_relationship/update"), Description: pointy.GetPointer("apiDesc.updateLabelRelationship"), ApiGroup: pointy.GetPointer("label_relationship"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label_relationship/delete"), Description: pointy.GetPointer("apiDesc.deleteLabelRelationship"), ApiGroup: pointy.GetPointer("label_relationship"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label_relationship/list"), Description: pointy.GetPointer("apiDesc.getLabelRelationshipList"), ApiGroup: pointy.GetPointer("label_relationship"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label_relationship"), Description: pointy.GetPointer("apiDesc.getLabelRelationshipById"), ApiGroup: pointy.GetPointer("label_relationship"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // Label _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label/create"), Description: pointy.GetPointer("apiDesc.createLabel"), ApiGroup: pointy.GetPointer("label"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label/update"), Description: pointy.GetPointer("apiDesc.updateLabel"), ApiGroup: pointy.GetPointer("label"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label/delete"), Description: pointy.GetPointer("apiDesc.deleteLabel"), ApiGroup: pointy.GetPointer("label"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label/list"), Description: pointy.GetPointer("apiDesc.getLabelList"), ApiGroup: pointy.GetPointer("label"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/label"), Description: pointy.GetPointer("apiDesc.getLabelById"), ApiGroup: pointy.GetPointer("label"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // Contact _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/contact/create"), Description: pointy.GetPointer("apiDesc.createContact"), ApiGroup: pointy.GetPointer("contact"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/contact/update"), Description: pointy.GetPointer("apiDesc.updateContact"), ApiGroup: pointy.GetPointer("contact"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/contact/delete"), Description: pointy.GetPointer("apiDesc.deleteContact"), ApiGroup: pointy.GetPointer("contact"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/contact/list"), Description: pointy.GetPointer("apiDesc.getContactList"), ApiGroup: pointy.GetPointer("contact"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/contact"), Description: pointy.GetPointer("apiDesc.getContactById"), ApiGroup: pointy.GetPointer("contact"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // Wx _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/wx/create"), Description: pointy.GetPointer("apiDesc.createWx"), ApiGroup: pointy.GetPointer("wx"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/wx/update"), Description: pointy.GetPointer("apiDesc.updateWx"), ApiGroup: pointy.GetPointer("wx"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/wx/delete"), Description: pointy.GetPointer("apiDesc.deleteWx"), ApiGroup: pointy.GetPointer("wx"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/wx/list"), Description: pointy.GetPointer("apiDesc.getWxList"), ApiGroup: pointy.GetPointer("wx"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/wx"), Description: pointy.GetPointer("apiDesc.getWxById"), ApiGroup: pointy.GetPointer("wx"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // Server _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/server/create"), Description: pointy.GetPointer("apiDesc.createServer"), ApiGroup: pointy.GetPointer("server"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/server/update"), Description: pointy.GetPointer("apiDesc.updateServer"), ApiGroup: pointy.GetPointer("server"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/server/delete"), Description: pointy.GetPointer("apiDesc.deleteServer"), ApiGroup: pointy.GetPointer("server"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/server/list"), Description: pointy.GetPointer("apiDesc.getServerList"), ApiGroup: pointy.GetPointer("server"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/server"), Description: pointy.GetPointer("apiDesc.getServerById"), ApiGroup: pointy.GetPointer("server"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } return err }