MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / ReleaseDo

Method ReleaseDo

controller/publish/iml.go:22–49  ·  view source on GitHub ↗
(ctx *gin.Context, serviceId string, input *dto.ApplyOnReleaseInput)

Source from the content-addressed store, hash-verified

20}
21
22func (c *imlPublishController) ReleaseDo(ctx *gin.Context, serviceId string, input *dto.ApplyOnReleaseInput) (*dto.Publish, error) {
23 newReleaseId, err := c.releaseModule.Create(ctx, serviceId, &dto2.CreateInput{
24 Version: input.Version,
25 Remark: input.VersionRemark,
26 })
27 if err != nil {
28 return nil, err
29 }
30 apply, err := c.publishModule.Apply(ctx, serviceId, &dto.ApplyInput{
31 Release: newReleaseId,
32 Remark: input.PublishRemark,
33 })
34 if err != nil {
35 return nil, err
36 }
37 err = c.publishModule.Accept(ctx, serviceId, apply.Id, "")
38 if err != nil {
39 c.releaseModule.Delete(ctx, serviceId, newReleaseId)
40 return nil, err
41 }
42
43 err = c.publishModule.Publish(ctx, serviceId, apply.Id)
44 if err != nil {
45 c.releaseModule.Delete(ctx, serviceId, newReleaseId)
46 return nil, err
47 }
48 return apply, err
49}
50
51func (c *imlPublishController) PublishStatuses(ctx *gin.Context, serviceId string, id string) ([]*dto.PublishStatus, error) {
52 return c.publishModule.PublishStatuses(ctx, serviceId, id)

Callers

nothing calls this directly

Calls 5

CreateMethod · 0.65
ApplyMethod · 0.65
AcceptMethod · 0.65
DeleteMethod · 0.65
PublishMethod · 0.65

Tested by

no test coverage detected