okhttp

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val url="http://localhost:8080/kotlin/hello.json"
var client=OkHttpClient()
var request=Request.Builder().url(url).get().build()
client.newCall(request).enqueue(object:Callback{
override fun onFailure(call: Call, e: IOException) {
} override fun onResponse(call: Call, response: Response) {
println("返回的内容是-----------------"+response.body?.string())
}}) // readPage()
}

gson解析json

1.简单测试

MainActivity.kt

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) val string="""{"name":"jack","age":"20","hobbies":{"indoor":"music","outdoor":"basketball"},"other":[{"workin":"baidu","duration":"3years"},{"workin":"google","duration":"1years"}]}""" val gson:Gson= Gson()
try {
val student = gson.fromJson<Student>(string, Student::class.java)
println(student.hobbies?.indoor)
println(student.other[1].workin)
println("解析json成功")
}catch (e:Exception){
println("解析json失败")
} }
}

Student.kt

open class Student {

    //{"name":"jack","age":"20","hobbies":{"indoor":"music","outdoor":"basketball"},"other":[{"workin":"baidu","duration":"3years"},{"workin":"google","duration":"1years"}]}
var name:String?=null
var age:Int?=null
var hobbies:Hobbies?=null
var other= listOf<Other>() }
open class Hobbies() {
var indoor:String?= null
var outdoor:String?=null
} open class Other(){
var workin:String?=null
var duration:String?=null
}

2.解析QQ音乐MV界面返回的json

写这个真心花了好长的时间。。那个发送get请求的url有空再研究下

MainActivity.kt

class MainActivity : AppCompatActivity() ,AnkoLogger{

    override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val url="https://u.y.qq.com/cgi-bin/musicu.fcg?-=mvlib9586712011620675&g_tk=5381&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq.json&needNewCode=0&data=%7B%22comm%22%3A%7B%22ct%22%3A24%7D%2C%22mv_list%22%3A%7B%22module%22%3A%22MvService.MvInfoProServer%22%2C%22method%22%3A%22GetAllocMvInfo%22%2C%22param%22%3A%7B%22start%22%3A0%2C%22size%22%3A20%2C%22version_id%22%3A7%2C%22area_id%22%3A19%2C%22order%22%3A0%7D%7D%7D&mv_list"
//val url="http://localhost:8080/kotlin/hotel.json"
var client=OkHttpClient()
var request=Request.Builder().url(url).get().build()
client.newCall(request).enqueue(object:Callback{
override fun onFailure(call: Call, e: IOException) {
} override fun onResponse(call: Call, response: Response) {
val gson: Gson= Gson()
try {
val mvListResp=gson.fromJson<MvListResp>(response.body?.string(),MvListResp::class.java)//object:TypeToken<MvListResp>(){}.type
println(mvListResp.mv_list?.data?.list!![0].singers[0].name)
} catch (e: Exception) {
println("解析JSON数据失败")
e.printStackTrace() }
}}) } }

MVListResponse.kt

class MvListResp {
var code: Int? = null
var ts: Long? = null
var mv_list: MvList? = null
} class MvList() {
var code: Int? = null
var data:MvListData?=null
var total: Int? = null
} class MvListData(){
var list= listOf<MvInfo>()
} class MvInfo() {
var comment_cnt: Int? = null
var diff: Int? = null
var duration: Int? = null
var has_fav: Int? = null
var has_star: Int? = null
var mv_switch: Int? = null
var mvid: Int? = null
var picurl: String? = null
var playcnt: Int? = null
var pubdate: Long? = null
var score: Int? = null
var singers = listOf<SingeInfo>()
var star_cnt: Int? = null
var subtitle: String? = null
var title: String? = null
var uploader: Uploader? = null
var vid: String? = null
} class SingeInfo() {
var id: Int? = null
var mid: String? = null
var name: String? = null
var picurl: String? = null
} class Uploader() {
var enc_uin: String? = null
var headurl: String? = null
var nick: String? = null
}

get请求返回json是这么一长串

{"code":0,"ts":1580987499140,"mv_list":{"code":0,"data":{ "list": [ { "comment_cnt": 3472, "diff": 0, "duration": 215, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1589332, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102002NciZ91bkihl.jpg", "playcnt": 3299374, "pubdate": 1577030400, "score": 0, "singers": [ { "id": 283148, "mid": "004NfJdF0gn6Z1", "name": "Red Velvet (레드벨벳)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004NfJdF0gn6Z1.jpg" } ], "star_cnt": 10082, "subtitle": "", "title": "Red Velvet《Psycho》MV", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "v0033f0aqxz" }, { "comment_cnt": 10069, "diff": 0, "duration": 193, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1517510, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1010003x77W1X0FA3.jpg", "playcnt": 15624622, "pubdate": 1554307200, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 52452, "subtitle": "", "title": "Kill This Love", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "l0030x5i9ek" }, { "comment_cnt": 2111, "diff": 0, "duration": 209, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1595732, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000eUr1s1uVAnh.jpg", "playcnt": 269312, "pubdate": 1580140800, "score": 0, "singers": [ { "id": 5675, "mid": "001NJAY04JwuK4", "name": "SUPER JUNIOR (슈퍼주니어)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001NJAY04JwuK4.jpg" } ], "star_cnt": 3686, "subtitle": "", "title": "2YA2YAO!", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "x00339hsdnm" }, { "comment_cnt": 2650, "diff": 0, "duration": 210, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1580456, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1010005WtQx0DKH4x.jpg", "playcnt": 2769098, "pubdate": 1573660800, "score": 0, "singers": [ { "id": 176744, "mid": "001p5MSX07YGwi", "name": "MAMAMOO (마마무)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001p5MSX07YGwi.jpg" } ], "star_cnt": 9816, "subtitle": "", "title": "HIP", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "u0032piim9h" }, { "comment_cnt": 5164, "diff": 0, "duration": 215, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1474621, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002LaPiL3SyAOs.jpg", "playcnt": 11125344, "pubdate": 1528992000, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 15351, "subtitle": "", "title": "DDU-DU DDU-DU (뚜두뚜두)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "v00260mpcch" }, { "comment_cnt": 2868, "diff": 0, "duration": 252, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 137284, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1030015eqbW1zwkBk.jpg", "playcnt": 112053964, "pubdate": 1342454400, "score": 0, "singers": [ { "id": 13143, "mid": "002vbc3A2bv88T", "name": "PSY (朴载相)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000002vbc3A2bv88T.jpg" }, { "id": 10415, "mid": "0040tgjy2qm5bG", "name": "泫雅 (현아)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M0000040tgjy2qm5bG.jpg" } ], "star_cnt": 17357, "subtitle": "", "title": "강남스타일 (Gangnam Style)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "j0015nxvoyg" }, { "comment_cnt": 5225, "diff": 0, "duration": 197, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1578560, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102003HhoWB1cqsNo.jpg", "playcnt": 3483598, "pubdate": 1572883200, "score": 0, "singers": [ { "id": 10415, "mid": "0040tgjy2qm5bG", "name": "泫雅 (현아)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M0000040tgjy2qm5bG.jpg" } ], "star_cnt": 16658, "subtitle": "", "title": "FLOWER SHOWER", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "l003273bvdk" }, { "comment_cnt": 2953, "diff": 0, "duration": 176, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1495127, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101003wxGgR0cUxSv.jpg", "playcnt": 10662355, "pubdate": 1541952000, "score": 0, "singers": [ { "id": 156564, "mid": "004QK4Dt0N2OX9", "name": "Jennie (제니)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004QK4Dt0N2OX9.jpg" } ], "star_cnt": 25444, "subtitle": "", "title": "SOLO", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "m00284h398b" }, { "comment_cnt": 1249, "diff": 0, "duration": 194, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1592395, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002IdYdQ2ZZzOx.jpg", "playcnt": 879905, "pubdate": 1578412800, "score": 0, "singers": [ { "id": 940913, "mid": "0029SxgR215af5", "name": "伯贤 (백현)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M0000029SxgR215af5.jpg" } ], "star_cnt": 4356, "subtitle": "", "title": "너를 사랑하고 있어 (《浪漫医生金师傅2》韩国电视剧插曲)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "z0033w2kkzc" }, { "comment_cnt": 3629, "diff": 0, "duration": 216, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1323921, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000fzlOv4HuKAE.jpg", "playcnt": 9586479, "pubdate": 1498060800, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 7328, "subtitle": "", "title": "As If It's Your Last (마지막처럼)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "m00240pahpk" }, { "comment_cnt": 843, "diff": 0, "duration": 239, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1474945, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101004ECMcc1hXlBu.jpg", "playcnt": 3314792, "pubdate": 1529424000, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 6419, "subtitle": "", "title": "Forever Young (练习室版)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "p0026n6t2m9" }, { "comment_cnt": 9183, "diff": 0, "duration": 191, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1062977, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M1010016ZLE70SvwcL.jpg", "playcnt": 17253074, "pubdate": 1480694400, "score": 0, "singers": [ { "id": 166667, "mid": "002iE9xv2DuIQT", "name": "灿烈 (찬열)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000002iE9xv2DuIQT.jpg" }, { "id": 176687, "mid": "000lHQbb1VAljd", "name": "PUNCH (펀치)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000000lHQbb1VAljd.jpg" } ], "star_cnt": 18130, "subtitle": "", "title": "Stay With Me (《孤单又灿烂的神-鬼怪》韩剧插曲)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "g0022jx5u6w" }, { "comment_cnt": 1386, "diff": 0, "duration": 259, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 79256, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000c88Ej3pIF7Z.jpg", "playcnt": 29472192, "pubdate": 1322668800, "score": 0, "singers": [ { "id": 37726, "mid": "004DOoCo0hMi1y", "name": "Trouble Maker (트러블메이커)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004DOoCo0hMi1y.jpg" } ], "star_cnt": 5660, "subtitle": "", "title": "Trouble Maker (麻烦制造者)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "f0016e85b12" }, { "comment_cnt": 3704, "diff": 0, "duration": 230, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 917352, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002nqSlZ0xFMQz.jpg", "playcnt": 9602424, "pubdate": 1470585600, "score": 0, "singers": [ { "id": 1190986, "mid": "003DBAjk2MMfhR", "name": "BLACKPINK", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000003DBAjk2MMfhR.jpg" } ], "star_cnt": 4942, "subtitle": "", "title": "휘파람 (WHISTLE) (口哨)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "h00214mr981" }, { "comment_cnt": 1982, "diff": 0, "duration": 195, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1343826, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102002XpS6f0FBWxF.jpg", "playcnt": 3401572, "pubdate": 1500307200, "score": 0, "singers": [ { "id": 38578, "mid": "001QVwtq3l8cKC", "name": "EXO (엑소)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001QVwtq3l8cKC.jpg" } ], "star_cnt": 7020, "subtitle": "", "title": "Ko Ko Bop (韩文版) (叩叩趴)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "i0029u40k89" }, { "comment_cnt": 639, "diff": 0, "duration": 279, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1589954, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101003Ax7uT1Vmi6f.jpg", "playcnt": 451546, "pubdate": 1577116800, "score": 0, "singers": [ { "id": 14207, "mid": "004Bjyj52RTYOj", "name": "IU (아이유)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004Bjyj52RTYOj.jpg" } ], "star_cnt": 3613, "subtitle": "", "title": "Blueming (Live At 2019 IU Tour Concert 'Love, poem')", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "s0033lji4ma" }, { "comment_cnt": 1939, "diff": 0, "duration": 186, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1595834, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101000EtreD4afOBm.jpg", "playcnt": 59366, "pubdate": 1580313600, "score": 0, "singers": [ { "id": 38578, "mid": "001QVwtq3l8cKC", "name": "EXO (엑소)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001QVwtq3l8cKC.jpg" }, { "id": 198895, "mid": "000xVBxt1xgiyW", "name": "QQ音乐", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000000xVBxt1xgiyW.jpg" } ], "star_cnt": 2733, "subtitle": "", "title": "第29届首尔歌谣大赏QQ音乐最受欢迎K-POP Artist奖: EXO (2020 首尔歌谣大赏)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "r0033sasmup" }, { "comment_cnt": 446, "diff": 0, "duration": 330, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1594591, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101002kMApV4QyioQ.jpg", "playcnt": 264598, "pubdate": 1579190400, "score": 0, "singers": [ { "id": 162691, "mid": "001TpDgn4SxyJn", "name": "BTS (防弹少年团)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001TpDgn4SxyJn.jpg" } ], "star_cnt": 2029, "subtitle": "", "title": "Black Swan (Art Film performed by MN Dance Company)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "u00335is4ma" }, { "comment_cnt": 1888, "diff": 0, "duration": 206, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1499989, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M101003SWIpY2dFdux.jpg", "playcnt": 3186092, "pubdate": 1544716800, "score": 0, "singers": [ { "id": 38578, "mid": "001QVwtq3l8cKC", "name": "EXO (엑소)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000001QVwtq3l8cKC.jpg" } ], "star_cnt": 11878, "subtitle": "", "title": "Love Shot (Live At Music Bank 2018\/12\/14)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "c0029hx0acq" }, { "comment_cnt": 326, "diff": 0, "duration": 215, "has_fav": 0, "has_star": 0, "mv_switch": 31, "mvid": 1592451, "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T015R640x360M102001iiaqZ0EDYn8.jpg", "playcnt": 225894, "pubdate": 1578412800, "score": 0, "singers": [ { "id": 283148, "mid": "004NfJdF0gn6Z1", "name": "Red Velvet (레드벨벳)", "picurl": "http:\/\/y.gtimg.cn\/music\/photo_new\/T001R150x150M000004NfJdF0gn6Z1.jpg" } ], "star_cnt": 1255, "subtitle": "", "title": "Red Velvet《Psycho》Performance Video (舞蹈版)", "uploader": { "enc_uin": "", "headurl": "", "nick": "" }, "vid": "s0033u4mq9z" } ], "total": 1000 }}}

可以试着把读取到的数据加载到视图。。

简单的适配

复杂点的适配

关键代码

private var list= ArrayList<MvInfo>()
fun updateList(list:List<MvInfo>){
this.list.clear()
this.list.addAll(list)
notifyDataSetChanged()
}

源码

链接:https://pan.baidu.com/s/1NAtDi6t0fdKQYs26ewNycQ
提取码:rmgo

<kotlin>基础,杂七杂八(亲测有效)的更多相关文章

  1. 推荐几个最好用的CRM软件,本人亲测

    CRM是英文Customer Relationship Management 的简写,一般译作“客户关系管理”.CRM最早产生于美国,由Gartner Group 首先提出的CRM这个概念的.20世纪 ...

  2. Linux 下 将使用Python-Django开发的web应用布置到服务器上(亲测有效)

    写在前面: Django是一个卓越的新一代Web框架,相信使用Python的人对此并不陌生,但将我们完成的web应用布置到到服务器上并不是一件容易的事情. Django详细的教程可以参考http:// ...

  3. myeclipse 9.0 破解方法,亲测可用

    MyEclipse 9.0的破解方法,步骤如下: 1.破解公钥,确保MyEclipse没有开启,否则失败! 用WinRAR打开Common\plugins\com.genuitec.eclipse.c ...

  4. idea插件(mybatis框架下mapper接口快速跳转对应xml文件)亲测好用!

    我相信目前在绝大部分公司里,主要使用的框架是S(spring)S(spring MVC)M(mybatis),其中mybatis总体架构是编写mapper接口,框架扫描其对应的mapper.xml文件 ...

  5. 亲测可用!在线购书系统项目分享(Java)

    项目简介 项目来源于:https://gitee.com/suimz_admin/BookShop 一个基于JSP+Servlet+Jdbc的书店系统.涉及技术少,易于理解,适合JavaWeb初学者学 ...

  6. nginx代理https站点(亲测)

    nginx代理https站点(亲测) 首先,我相信大家已经搞定了nginx正常代理http站点的方法,下面重点介绍代理https站点的配置方法,以及注意事项,因为目前大部分站点有转换https的需要所 ...

  7. C#读取Excel设置(亲测可用)

    OpenFileDialog openFD = new OpenFileDialog(); openFD.FileName = ""; openFD.Filter = " ...

  8. ASP.NET中的文件操作(文件信息,新建,移动,复制,重命名,上传,遍历)(亲测详细)

    做了几天的文件操作,现在来总结一下,错误之处,还望指点!以文件为例,如果对文件夹操作,基本上将File换为Directory即可(例:FileInfo file = new FileInfo(Path ...

  9. linux 系统下开机自动启动oracle 监听和实例 (亲测有效)

    [oracle@oracle11g ~]$ dbstartORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listene ...

  10. IntelliJ13+tomcat+jrebel实现热部署(亲测可用)

       网上有很多介绍intellij idea整合jrebel插件实现热部署的文章,但是有的比较复杂,有的不能成功,最后经过各种尝试,实现了整合,亲测可用!步骤说明如下:   一.先下载jrebel安 ...

随机推荐

  1. 201706 gem 'rails-erd'生成Model关系图

    [工具]一张图理清各个model之间关系 安装 Graphviz 2.22+: 终端机中执行 brew install graphviz Gemfile中添加 gem 'rails-erd' 终端机中 ...

  2. ROS学习笔记3-基础课程之文件系统向导

    准备工作需要使用如下命令安装ros的教程: $ sudo apt-get install ros-<distro>-ros-tutorials 其中,distro为所用ros的发行版本,该 ...

  3. $('#myModal').modal('show') //显示$('#myModal').modal('hide')隐藏

    你这样试试,这是官方文档的写法 $('#myModal').modal('show') //显示$('#myModal').modal('hide')隐藏 //重复点击的隐藏显示有一个很更方便的写法$ ...

  4. phpStudy隐藏后门预警

    1.事件背景 近日,使用广泛的PHP环境集成程序包phpStudy被公告疑似遭遇供应链攻击,程序包自带PHP的php_xmlrpc.dll模块隐藏有后门,安恒应急响应中心和研究院随即对国内下载站点提供 ...

  5. docker学习笔记-04:docker容器数据卷

    一.容器数据卷是什么 1.为了保存docker容器运行时产生的数据,做数据的持久化,我们需要用到容器数据卷.因为如果不通过docker commit 生成新的镜像,那么当容器被删除时,数据自然就没有了 ...

  6. php 获取时间段

    switch ($type){ case 'day'://当日 $end=date(,,,date(,date('Y'))); $where=' and '.$pre.'create_time> ...

  7. Spark Storage 模块

    http://jerryshao.me/architecture/2013/10/08/spark-storage-module-analysis/ 大神写的太好了,我就不重复造轮子了. Spark ...

  8. docker安装centos7镜像

    拉取centos7镜像[root@localhost ~]# docker pull centos:71启动镜像centos7,如果不指定 /bin/bash,容器运行后会自动停止[root@loca ...

  9. 02 DML(DataManipulationLanguage)

    1.插入记录     基本语法 :         INSERT INTO tbl_name (col_name ,col_name1,..,col_nameN) VALUES (val1,val2, ...

  10. UVA - 122 Trees on the level (二叉树的层次遍历)

    题意:给定结点值和从根结点到该结点的路径,若根到某个叶结点路径上有的结点输入中未给出或给出超过一次,则not complete,否则层次遍历输出所有结点. 分析:先建树,建树的过程中,沿途结点都申请了 ...