Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
847ec90
commit 4d1f691
Showing
85 changed files
with
16,298 additions
and
1,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# grails_test | ||
some test cases based on grails | ||
|
||
这部分代码今天(2015年5月19日)用于v2.onlysleep.net的源码。 | ||
仅用于日常开发测试使用。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import com.alibaba.fastjson.JSONObject | ||
|
||
class RssEmailController { | ||
def index() { | ||
redirect(action: "/") | ||
} | ||
|
||
def rssAdd = { | ||
def email = params.email | ||
RssEmail rssEmail = new RssEmail(userEmail:email,state: 1,uuid: UUID.randomUUID().toString(),createDate: new Date()) | ||
JSONObject result = new JSONObject() | ||
if (rssEmail.validate()){ | ||
if (rssEmail.save(flush: true)){ | ||
result.put("result","1") | ||
} | ||
}else{ | ||
result.put("result","0") | ||
} | ||
render result.toString() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Rss订阅 | ||
* @author ZhangJingtao | ||
*/ | ||
class RssEmail { | ||
|
||
static constraints = { | ||
userEmail(email: true,unique: true,nullable: false) | ||
state(inList: [0,1]) | ||
uuid(nullable: false) | ||
} | ||
static mapping = { | ||
|
||
} | ||
String userEmail | ||
Date createDate | ||
String uuid | ||
Integer state | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.