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) { // BatchMsg _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/batch_msg/create"), Description: pointy.GetPointer("apiDesc.createBatchMsg"), ApiGroup: pointy.GetPointer("batch_msg"), 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("/batch_msg/update"), Description: pointy.GetPointer("apiDesc.updateBatchMsg"), ApiGroup: pointy.GetPointer("batch_msg"), 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("/batch_msg/delete"), Description: pointy.GetPointer("apiDesc.deleteBatchMsg"), ApiGroup: pointy.GetPointer("batch_msg"), 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("/batch_msg/list"), Description: pointy.GetPointer("apiDesc.getBatchMsgList"), ApiGroup: pointy.GetPointer("batch_msg"), 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("/batch_msg"), Description: pointy.GetPointer("apiDesc.getBatchMsgById"), ApiGroup: pointy.GetPointer("batch_msg"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // MessageRecords _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/message_records/create"), Description: pointy.GetPointer("apiDesc.createMessageRecords"), ApiGroup: pointy.GetPointer("message_records"), 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("/message_records/update"), Description: pointy.GetPointer("apiDesc.updateMessageRecords"), ApiGroup: pointy.GetPointer("message_records"), 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("/message_records/delete"), Description: pointy.GetPointer("apiDesc.deleteMessageRecords"), ApiGroup: pointy.GetPointer("message_records"), 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("/message_records/list"), Description: pointy.GetPointer("apiDesc.getMessageRecordsList"), ApiGroup: pointy.GetPointer("message_records"), 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("/message_records"), Description: pointy.GetPointer("apiDesc.getMessageRecordsById"), ApiGroup: pointy.GetPointer("message_records"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // SopNode _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/sop_node/create"), Description: pointy.GetPointer("apiDesc.createSopNode"), ApiGroup: pointy.GetPointer("sop_node"), 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("/sop_node/update"), Description: pointy.GetPointer("apiDesc.updateSopNode"), ApiGroup: pointy.GetPointer("sop_node"), 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("/sop_node/delete"), Description: pointy.GetPointer("apiDesc.deleteSopNode"), ApiGroup: pointy.GetPointer("sop_node"), 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("/sop_node/list"), Description: pointy.GetPointer("apiDesc.getSopNodeList"), ApiGroup: pointy.GetPointer("sop_node"), 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("/sop_node"), Description: pointy.GetPointer("apiDesc.getSopNodeById"), ApiGroup: pointy.GetPointer("sop_node"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // SopStage _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/sop_stage/create"), Description: pointy.GetPointer("apiDesc.createSopStage"), ApiGroup: pointy.GetPointer("sop_stage"), 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("/sop_stage/update"), Description: pointy.GetPointer("apiDesc.updateSopStage"), ApiGroup: pointy.GetPointer("sop_stage"), 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("/sop_stage/delete"), Description: pointy.GetPointer("apiDesc.deleteSopStage"), ApiGroup: pointy.GetPointer("sop_stage"), 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("/sop_stage/list"), Description: pointy.GetPointer("apiDesc.getSopStageList"), ApiGroup: pointy.GetPointer("sop_stage"), 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("/sop_stage"), Description: pointy.GetPointer("apiDesc.getSopStageById"), ApiGroup: pointy.GetPointer("sop_stage"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // SopTask _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{ ServiceName: pointy.GetPointer("Wechat"), Path: pointy.GetPointer("/sop_task/create"), Description: pointy.GetPointer("apiDesc.createSopTask"), ApiGroup: pointy.GetPointer("sop_task"), 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("/sop_task/update"), Description: pointy.GetPointer("apiDesc.updateSopTask"), ApiGroup: pointy.GetPointer("sop_task"), 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("/sop_task/delete"), Description: pointy.GetPointer("apiDesc.deleteSopTask"), ApiGroup: pointy.GetPointer("sop_task"), 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("/sop_task/list"), Description: pointy.GetPointer("apiDesc.getSopTaskList"), ApiGroup: pointy.GetPointer("sop_task"), 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("/sop_task"), Description: pointy.GetPointer("apiDesc.getSopTaskById"), ApiGroup: pointy.GetPointer("sop_task"), Method: pointy.GetPointer("POST"), }) if err != nil { return err } // 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 }