| 226 | } |
| 227 | |
| 228 | func (i *imlSubscribeApplyService) ListByStatus(ctx context.Context, pid string, status ...int) ([]*Apply, error) { |
| 229 | w := make(map[string]interface{}) |
| 230 | w["service"] = pid |
| 231 | if len(status) > 0 { |
| 232 | w["status"] = status |
| 233 | } |
| 234 | list, err := i.store.List(ctx, w, "apply_at desc") |
| 235 | if err != nil { |
| 236 | return nil, err |
| 237 | } |
| 238 | return utils.SliceToSlice(list, FromApplyEntity), nil |
| 239 | } |
| 240 | |
| 241 | func (i *imlSubscribeApplyService) RevokeById(ctx context.Context, id string) error { |
| 242 | _, err := i.store.UpdateWhere(ctx, map[string]interface{}{"uuid": id}, map[string]interface{}{"status": -1}) |