(c *gin.Context)
| 59 | ) |
| 60 | |
| 61 | func (service *BsEncodeService) Encode(c *gin.Context) (*BsEncodeRes, error) { |
| 62 | bs := &boolset.BooleanSet{} |
| 63 | for _, v := range service.Bool { |
| 64 | boolset.Set(v, true, bs) |
| 65 | } |
| 66 | |
| 67 | res, err := bs.MarshalBinary() |
| 68 | if err != nil { |
| 69 | return nil, err |
| 70 | } |
| 71 | |
| 72 | return &BsEncodeRes{ |
| 73 | Hex: hex.EncodeToString(res), |
| 74 | B64: res, |
| 75 | }, nil |
| 76 | } |
| 77 | |
| 78 | type ( |
| 79 | BsDecodeService struct { |
nothing calls this directly
no test coverage detected