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
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import org.springframework.jdbc.core.RowMapper; | |
import org.springframework.stereotype.Repository; | |
import tutorial.springsetup.entity.Game; |
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
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import org.springframework.jdbc.core.RowMapper; | |
import org.springframework.stereotype.Repository; | |
import tutorial.springsetup.entity.Game; | |
@Repository |
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
import org.springframework.stereotype.Repository; | |
@Repository | |
public class GameJDBCRepository extends BaseJDBCRepository { | |
} |
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
import javax.sql.DataSource; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.core.env.Environment; | |
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
import org.springframework.stereotype.Repository; | |
import org.springframework.transaction.annotation.Transactional; | |
@Repository | |
@Transactional |
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
import UIKit | |
class CommentViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Create a test comment | |
let comment = Comment() | |
comment.author = "Dayna" |
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
import Foundation | |
struct Constants { | |
struct URL { | |
static let baseUrl = "http://localhost:8080/api" | |
static let searchGamesByTitle = baseUrl + "/games?title=" | |
static let createGameComment = baseUrl + "/games/{gameId}/comments" | |
} | |
} |
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
typealias PostCompletionHandler = (NSDictionary) -> () | |
static func post(postUrl: String, body: [String: AnyObject], completionHandler: @escaping (PostCompletionHandler)){ | |
let url = URL(string:postUrl)! | |
var request = URLRequest(url: url) | |
request.httpMethod = "POST" | |
request.addValue("application/json", forHTTPHeaderField: "Content-Type") // Set as JSON content-type | |
request.addValue("application/json", forHTTPHeaderField: "Accept") |
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
import Foundation | |
class Comment { | |
var id: Int? | |
var game: Game? | |
var author: String? | |
var text: String? | |
var createdDate: String? | |
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
import UIKit | |
import DZNEmptyDataSet | |
class ViewController: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate { | |
@IBOutlet var tableView: UITableView! | |
let tungsten: UIColor = UIColor(red:0.20, green:0.20, blue:0.20, alpha:1.0) | |
override func viewDidLoad() { |
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
import UIKit | |
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
var gameResults = [Game]() | |
@IBOutlet var tableView: UITableView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
setupTableView() |
NewerOlder