예제 #1
0
func (d *ExtendController) Delete(w rest.ResponseWriter, req *rest.Request) {
	data := new(model.Extend)
	err := data.Del(req.PathParam("id"))
	if err != nil {
		w.WriteJson(0)
		return
	}
	// TODO: 将extend中dataId的数据删除
	w.WriteJson(1)
}
예제 #2
0
func (d *ExtendController) DeleteAll(idStr string) {
	idStr = strings.Replace(idStr, "|", ".", -1)
	idStr = strings.Replace(idStr, ";", ".", -1)
	idStr = strings.Replace(idStr, ";", ".", -1)
	idStr = strings.Replace(idStr, ",", ".", -1)
	idStr = strings.Replace(idStr, ",", ".", -1)
	ids := strings.Split(idStr, ".")
	//
	data := new(model.Extend)
	fail := make([]string, len(ids), len(ids))
	for i := 0; i < len(ids); i++ {
		if ids[i] != "" {
			err := data.Del(ids[i])
			if err != nil {
				fail[i] = ids[i]
			}
		}
	}
	fmt.Println("----fail--%v----", fail)

}